<!DOCTYPE HTML>
<html>

	<head>
		<title>Modern an Admin Panel Category Flat Bootstarp Resposive Website Template | Login :: w3layouts</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="keywords" content="Modern Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
		<script type="application/x-javascript">
			addEventListener("load", function() {
				setTimeout(hideURLbar, 0);
			}, false);

			function hideURLbar() {
				window.scrollTo(0, 1);
			}
		</script>
		<!-- Bootstrap Core CSS -->
		<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/bootstrap-3.3.4.css">
		<!-- Custom CSS -->
		<link href="css/style.css" rel='stylesheet' type='text/css' />
		<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
		<!-- jQuery -->
		<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>

		<!---//webfonts--->
		<!-- Bootstrap Core JavaScript -->
		<script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
	</head>

	<body>
		<div id=".login">

			<div class="login-logo">
				<!--<a href="index.html"><img src="images/logo.png" alt=""/></a>-->
			</div>
			<h2 class="form-heading">- 饱了吗后台管理  -</h2>
			<div class="app-cam">

				<form action="http://befull.mcaa.win/cookLogin.action" onsubmit="return toVaild()">
					<input type="text" class="text" name="userName" id="cookid" placeholder="手机号/用户名" />
					<input type="password" name="password" id="password" placeholder="密码" />
					<div class="submit"><input type="submit" value="登录" ></div>
					<div>
						<h2 id="errorTip" class="error-font"></h2> </div>
					<div class="login-social-link">
				</form>
				</div>

			</div>

		</div>
		<div id="seldiv" style="width: 700px; position: absolute;bottom: 0px; left: 0px; opacity: 0;">
			<dl id="overlay" onmouseover="mouseOver(this)" onmouseout="mouseOut(this)" style="text-align:center">
				<ul class="inline">
					<a href="Resume/Resume.html">变身吧皮卡</a>
				</ul>
			</dl>
		</div>
	</body>

</html>
<script src="js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
	function toVaild() {
		
		var username = document.getElementById("cookid").value;
		var passwordval = document.getElementById("password").value;
		if(username == "" || passwordval == "") {
			$("#errorTip").empty();
			$("#errorTip").append("请输入账号或密码！")
			return false;
		}
		return true;
//		alert(login())
//		return login();

		
		
		
	}
	
	function login(){
		var username = document.getElementById("cookid").value;
		var passwordval = document.getElementById("password").value;

		$.ajax({
			type: "POST",
			url: "http://http://befull.mcaa.win/cookLogin.action",
			data: {
				userName: username
//				password: passwordval
			},
			dataType: "JSONP",
			jsonp: "callback", //传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名,默认为callback
			success: function(data) {
				alert(data.data.success)
				if(data.data.success==true){
					return true;
				}else{
					$("#errorTip").empty();
					$("#errorTip").append("密码或账号输入错误")
					return false;
				}

			},
			error: function() {
				$("#errorTip").empty();
				$("#errorTip").append("服务器错误")
				return false;
			}
		})
	}
		

	function mouseOver() {
		var overlay = document.getElementById('seldiv');
		startrun(overlay, "opacity", 100.0);
	}

	function mouseOut() {
		var overlay = document.getElementById('seldiv');
		startrun(overlay, "opacity", 0.0);

	}

	function startrun(obj, attr, target, fn) {
		clearInterval(obj.timer);
		obj.timer = setInterval(function() {
			var cur = 0;
			if(attr == "opacity") {
				cur = Math.round(parseFloat(getstyle(obj, attr)) * 100);
			} else {
				cur = parseInt(getstyle(obj, attr));
			}
			var speed = (target - cur) / 8;
			speed = speed > 0 ? Math.ceil(speed) : Math.floor(speed);

			if(cur == target) {
				clearInterval(obj.timer);
				if(fn) {
					fn();
				}
			} else {
				if(attr == "opacity") {
					obj.style.filter = "alpha(opacity=" + (cur + speed) + ")";
					obj.style.opacity = (cur + speed) / 100;
				} else {
					obj.style[attr] = cur + speed + "px";
				}
			}
		}, 30);
	}

	function getstyle(obj, name) {
		if(obj.currentStyle) {
			return obj.currentStyle[name];
		} else {
			return getComputedStyle(obj, false)[name];
		}
	}
</script>